<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/home/include/init_home.jsp" %>

<%
	String word_id			= StringUtil.nvl(request.getParameter("word_id"));
	String password			= StringUtil.nvl(request.getParameter("password"));
	String check_result		= "false";

	if (!password.equals("")) {
		HashMap infos = new HashMap();
		infos.put("word_id",	word_id);

		BoardDAO boardDAO 		= new BoardDAO();
		HashList wordList		= boardDAO.selectWordDetail(infos);

		if (password.equals(wordList.get("password",0))) {
			check_result = "true";
		}
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%= HOME_NAME %></title>
<link href="../css/home.css" rel="stylesheet" type="text/css">
<script>

	function btn_Init()
	{
		if (<%= check_result %>) {
			parent.btn_Close(true, '<%= password %>');
		} else {
<%			if (!password.equals("")) {	%>
				alert("비밀번호가 일치하지 않습니다.");
<%			}	%>
			document.frm.password.focus();
		}
	}


	function btn_Cancel()
	{
		parent.btn_Close(false, '');
	}

	function btn_Confirm()
	{
		if (document.frm.password.value == "")
		{
			alert("비밀번호를 입력해 주십시요.")
			document.frm.password.focus()
		}
		else
		{
			document.frm.submit();
		}
	}
</script>

</head>

<body bgcolor="#FFFFFF" text="#000000" onLoad="btn_Init()">


<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="10">
<form name="frm" method="post">
<input type="hidden" name="jobType"		value="">
<input type="hidden" name="word_id"		value="<%= word_id %>">
  <tr>
	<td align="center">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
		<tr>
		  <td align="center" height="200">

		  	<table  border="0" cellspacing="0" cellpadding="0" >
		  	<tr height="30">
		  		<td width="60" class="tex1"><b>비밀번호</b></td>
		  		<td><input type="password" name="password" size="15" maxlength="25" class="inputTL"></td>
		  	</tr>

		  	<tr>
		  		<td> </td>
		  		<td>
		  			<img src="/images/icon/btn_confirm.gif" style="cursor:hand" onclick="btn_Confirm()" >
		  			<img src="/images/icon/btn_cancel.gif" style="cursor:hand" onclick="btn_Cancel()" >
		  		</td>
		  	</tr>

			</table>
		  </td>
		</tr>
	  </table>
	</td>
  </tr>
</form>
</table>
</body>
</html>
